#include <iostream>
using namespace std;

// macros
 #define FUNrecursive( x ) ( x--; if(x){ FUNrecursive(x); }else{ return x;} )
//#define FUNrecursive( x ) ( x-1 )

// test friend function
class A{
public:
    int a; 
    void setb(const int _b){ b=_b; }     
  
private:
    int b;     
    
    // firend have to be inside of the class     
    // iostream only can be friend or general overloading function 
    friend ostream & operator<< ( ostream &out, const A &a );
};

// access private
ostream & operator<< ( ostream &out, const A &a ){
    out << a.a << endl;
    out << a.b << endl;    
    return out;
}

// only access public 
/*
ostream & operator<< ( ostream &out, const A &a ){
    out << a.a << endl;  
    return out;
}
*/
      
int main()
{
    A a;
    a.a = 123;
    a.setb(456);
    
    //cout <<"No friend: " << a << endl;
    
    int test = FUNrecursive(10);    
    cout<< "macro: " << test << endl;
}
